<template>
  <div>
   <!-- 面包屑 -->
   <el-breadcrumb separator="/">
     <el-breadcrumb-item :to="{ path: '/Welcome' }">首页</el-breadcrumb-item>
     <el-breadcrumb-item>报表管理</el-breadcrumb-item>
   </el-breadcrumb>
   <!-- 卡片 -->
   <el-card>
     <div id="main"></div>
  </el-card>
  </div>
</template>

<script>
import echarts from 'echarts'
export default {
  async mounted () {
    var myChart = echarts.init(document.getElementById('main'))
    const { data: res } = await this.$axios.get('reports/type/1')
    res.data.xAxis[0].boundaryGap = false
    res.data.tooltip = {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        label: {
          backgroundColor: '#E9EEF3'
        }
      }
    }
    myChart.setOption(res.data)
  }
}
</script>

<style scoped>
#main {
  width: 800px;
  height: 500px;
}
</style>
